/**
 * Created By wifi_uncle on 2019/11/6
 */

import API from '../api'
import request from './request';
export default {
    /**
   * 获取分销公司报备过的所有历史楼盘列表
   */
  getAgencyHisReportedPremises ({params, _this}) {
    let url = API.PREMISE.GET_AGENCY_HIS_REPORTED_PREMISES
    const errorMsg = "获取楼盘列表失败"
    return request({
      _this,
      errorMsg,
      body: { params },
      url,
      method: 'post'
    }).then(rsp => rsp.resData.list)
  },
  /**
   * 获取楼盘列表
   */
  getPremiseList ({params, _this}) {
    let url = API.PREMISE.GET_AGENT_PREMISES_LIST
    const errorMsg = "获取楼盘列表失败"
    return request({
      _this,
      errorMsg,
      body: { params },
      url,
      method: 'post'
    }).then(rsp => rsp.resData.getAgentPremisesList)
  },

  /**
   *  一客多盘报备校验
   */
  checkReportList ({params, _this}) {
    let url = API.PREMISE.CHECK_REPORT_LIST
    const errorMsg = "楼盘校验失败"
    return request({
      _this,
      errorMsg,
      body: { params },
      url,
      method: 'post',
      showErrorMsg: false
    })
  },
  /**
   *  一客多盘报备保存
   */
  saveReportList ({params, _this}) {
    let url = API.PREMISE.SAVE_REPORT_LIST
    const errorMsg = "报备保存失败"
    return request({
      _this,
      errorMsg,
      body: { params },
      url,
      method: 'post'
    }).then(rsp => rsp.resData)
  },
}
